import request from '@/utils/request'

// 获取地址
export function getAddress(data) {
    return request({
        url: '/Index/Index/addresst',
        method: 'post',
        data: data
    })
}

/**
 * 货源列表
 * @param {zt-1 全部 0 上架 1下架,ship_address发货地,to_address收货地} params 
 * @returns 
 */
export function getSource(params) {
    return request({
        url: "/getSourceGoodsList",
        method: 'get',
        params
    })
}

/**
 * 删除货源
 * @param {hyid货源id} data 
 * @returns 
 */
export function delSource(data = {}) {
    return request({
        url: '/delSource',
        method: 'post',
        data
    })
}

/**
 * 下架货源
 * @param {hyid货源id} data 
 * @returns 
 */
export function offShelf(data = {}) {
    return request({
        url: '/offShelf',
        method: 'post',
        data
    })
}

/**
 * 上架货源
 * @param {hyid} data 
 * @returns 
 */
export function grounding(data = {}) {
    return request({
        url: '/grounding',
        method: 'post',
        data
    })
}

/**
 * 货源详情
 * @param {hyid} params 
 * @returns 
 */
export function sourceDetail(params = {}) {
    return request({
        url: "/sourceDetail",
        method: 'get',
        params
    })
}